<template>
  <div class="page-cont">
    <van-nav-bar
      title="通知"
      left-arrow
      @click-left="$router.go(-1)"
    />
    <scroll-list
      v-model="list"
      @onLoad="onLoad"
    >
      <notice-item
        v-for="(item, i) in list"
        :key="i"
        :notice="item"
      />
    </scroll-list>
  </div>
</template>

<script>
import ScrollList from '@/components/ScrollList/index.vue'
import NoticeItem from './components/NoticeItem.vue'

export default {
  name: "NoticePage",
  components: {
    NoticeItem,
    ScrollList
  },
  data() {
    return {
      list: [],
    };
  },
  methods: {
    async onLoad(page, done) {
      // 模拟获取数据
      let list = await this.api.GET_APP_NOTICE()
      this.list.push(...list)

      // 触发加载完成 大于50模拟全部加载完成
      done(true)
    }
  }
};
</script>

<style lang="scss" scoped>
@import "./style.scss";
</style>
